package com.zj.fx.controller;

import com.zj.fx.common.base.BaseController;
import com.zj.fx.common.domain.AjaxResult;
import com.zj.fx.model.auto.TsysUser;
import com.zj.fx.model.custom.SysMenu;
import com.zj.fx.shiro.util.ShiroUtils;
import com.zj.fx.util.StringUtils;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
@RequestMapping("/star")
@RequiredArgsConstructor
public class StarIndexController extends BaseController {
    private static Logger logger = LoggerFactory.getLogger(StarIndexController.class);

    private final String prefix = "report";

    @ApiOperation(value = "首页", notes = "首页")
    @GetMapping("/index")
    public String index(HttpServletRequest request) {
//        request.getSession().setAttribute("sessionUserName", ShiroUtils.getUser().getNickname());
        return prefix + "/index";
    }

    @ApiOperation(value = "访问首页供电所名单", notes = "访问首页供电所名单")
    @GetMapping("/starLevel")
    public String starLevel() {
        return prefix + "/starLevel";
    }

    @ApiOperation(value = "星级供电所评价标准", notes = "星级供电所评价标准")
    @GetMapping("/evaluationCriteria")
    public String evaluationCriteria() {
        return prefix + "/evaluationCriteria";
    }

    @ApiOperation(value = "评价结果汇总（月度）", notes = "评价结果汇总（月度）")
    @GetMapping("/result")
    public String result() {
        return prefix + "/result";
    }

    @ApiOperation(value = "首页", notes = "首页")
    @GetMapping("/loginindex")
    public String loginindex(HttpServletRequest request) {
        return prefix + "/loginindex";
    }
}
